jQuery(document).ready(function() {
    jQuery("#loginWrapper").dialog({autoOpen: false, width: 500, height: 500});

    //bind the click function on login link
    jQuery("a#login_link").bind("click", function() {
        jQuery("#loginWrapper").dialog({
            autoOpen: false,
            width: 500,
            height: 250,
            show: {
                effect: "blind",
                duration: 1000
            },
            hide: {
                effect: "explode",
                duration: 1000
            },
            close: function() {
                jQuery("#loginWrapper").dialog("destroy");
            }
        });

        jQuery("#loginWrapper").dialog("open");
    });

    jQuery(".showLogin").bind("click", function() {
        jQuery("#loginWrapper").dialog({
            autoOpen: false,
            width: 500,
            height: 250,
            show: {
                effect: "blind",
                duration: 1000
            },
            hide: {
                effect: "explode",
                duration: 1000
            },
            close: function() {
                jQuery("#loginWrapper").dialog("destroy");
            }
        });

        jQuery("#loginWrapper").dialog("open");
    });
});


